package exltemplate;

import MyExcelTool.BaseTemplate;
import MyExcelTool.Reader;

public class BudgetExcel extends BaseTemplate implements Reader {

	public void read() {
		String B5=getCell(1, 4);
		float C5=getFloat(2, 4);
		
		String B6=getCell(1, 5);
		float C6=getFloat(2, 5);
		
		String B7=getCell(1, 6);
		float C7=getFloat(2, 6);
		
		String B8=getCell(1, 7);
		float C8=getFloat(2, 7);
		
		String B9=getCell(1, 8);
		float C9=getFloat(2, 8);
		
		String B10=getCell(1, 9);
		float C10=getFloat(2, 9);
		
		String B11=getCell(1, 10);
		float C11=getFloat(2, 10);
		
		String B12=getCell(1, 11);
		float C12=getFloat(2, 11);
		
		String B13=getCell(1, 12);
		float C13=getFloat(2, 12);
		
		String B14=getCell(1, 13);
		float C14=getFloat(2, 13);
		
		System.out.println(B7+":"+C7);
        System.out.println(B8+":"+C8);
        System.out.println(B9+":"+C9);
        System.out.println(B10+":"+C10);
        System.out.println(B11+":"+C11);
        System.out.println(B12+":"+C12);
        System.out.println(B13+":"+C13);
        System.out.println(B14+":"+C14);
        
        double A=C7+C7/(C7+C8+C9+C10+C11)*(C6+C13+C14);
        double B=C8+C8/(C7+C8+C9+C10+C11)*(C6+C13+C14);
        double C=C8+C8/(C7+C8+C9+C10+C11)*(C6+C13+C14);
        double D=C8+C8/(C7+C8+C9+C10+C11)*(C6+C13+C14);
        double E=C8+C8/(C7+C8+C9+C10+C11)*(C6+C13+C14);
        
        double P1=A/(A+B+C+D+E)*100;
        P1=roundscale(P1,2);
        double P2=B/(A+B+C+D+E)*100;
        P2=roundscale(P2,2);
        double P3=C/(A+B+C+D+E)*100;
        P3=roundscale(P3,2);
        double P4=D/(A+B+C+D+E)*100;
        P4=roundscale(P4,2);
        double P5=E/(A+B+C+D+E)*100;
        P5=roundscale(P5,2);
        
	        
        System.out.println("P1:"+P1);
        System.out.println("P2:"+P2);
        System.out.println("P3:"+P3);
        System.out.println("P4:"+P4);
        System.out.println("P5:"+P5);
	}

}
